//面试 std_enable_if / __cplusplus
#include <iostream>
#include <type_traits>
using namespace std;

template <typename T>
typename std::enable_if<std::is_integral<T>::value, bool>::type gt_zero(T i) {
  cout << "is integral.";
  return i > 0;
}
template <typename T>
typename std::enable_if<!std::is_integral<T>::value, bool>::type gt_zero(T i) {
  cout << "is float.";
  return i < 0;
}

int main() {
  cout << __cplusplus << endl;

  short int i = 2;
  float f = 3.1f;
  std::cout << i << " > 0 " << gt_zero(i) << std::endl;
  std::cout << f << " > 0 " << gt_zero(f) << std::endl;
  return 0;
}
